#include "SplashState.h"


SplashState::SplashState()
{
	//--
}

SplashState::~SplashState()
{
	//--
}

void SplashState::OnEvent(SDL_Event *Event)
{
	
}

bool SplashState::OnInit(SDL_Surface* p_SurfDisplay)
{
	std::cout<<" INIT: SplashState  "<<std::endl;

	mImageSplash=GraphicsUtil::getInstance().Create_SDLSurface("resources\\images\\splash.png",1);
	mIntroStart=SDL_GetTicks();
	return true;
}
void SplashState::OnLoop()
{
	std::cout<<" LOOP: SplashState  "<<std::endl;
	mIntroStop=SDL_GetTicks();
	if((mIntroStop-mIntroStart)>Game::DELAY_INTRO)
	{
		std::cout<<"END SplashState .=================== "<<std::endl;
		Game::StateManager::GetInstance().SetState(Game::State::MAINMENU);
	}
}

void SplashState::OnRender(SDL_Surface *p_SurfDisplay)
{
	std::cout<<" Render: SplashState  "<<std::endl;
	GraphicsUtil::getInstance().Render_SDLSurface(p_SurfDisplay,mImageSplash, 0,0);
}

void SplashState::OnCleanup()
{
	std::cout<<" Clean UPP: SplashState  "<<std::endl;
	GraphicsUtil::getInstance().ClearSDLSurfaces();
}